home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / M / Mac gperf 1.9.cpt / Mac gperf 1.9 / src / keylist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-09  |  2.3 KB  |  61 lines  |  [TEXT/KAHL]

  1. /* Data and function member declarations for the keyword list class.
  2.  
  3.    Copyright (C) 1989 Free Software Foundation, Inc.
  4.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  5.  
  6. This file is part of GNU GPERF.
  7.  
  8. GNU GPERF is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 1, or (at your option)
  11. any later version.
  12.  
  13. GNU GPERF is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU GPERF; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  21.  
  22. /* The key word list is a useful abstraction that keeps track of
  23.    various pieces of information that enable that fast generation
  24.    of the Perfect.hash function.  A Key_List is a singly-linked
  25.    list of List_Nodes. */
  26.  
  27. #ifndef _keylist_h
  28. #define _keylist_h
  29.  
  30. #include <stdio.h>
  31. #include "listnode.h"
  32.  
  33. typedef struct key_list
  34. {
  35.   LIST_NODE *    head;                    /* Points to the head of the linked list. */
  36.   char *        array_type;                /* Pointer to the type for word list. */
  37.   char *        return_type;            /* Pointer to return type for lookup function. */
  38.   char *        struct_tag;                /* Shorthand for user-defined struct tag type. */
  39.   char *        include_src;            /* C source code to be included verbatim. */
  40.   int            list_len;                /* Length of head's Key_List, not counting duplicates. */
  41.   int            total_keys;                /* Total number of keys, counting duplicates. */
  42.   int            max_key_len;            /* Maximum length of the longest keyword. */
  43.   int            min_key_len;            /* Minimum length of the shortest keyword. */
  44.   bool            occurrence_sort;        /* True if sorting by occurrence. */
  45.   bool            hash_sort;                /* True if sorting by hash value. */
  46.   bool            additional_code;        /* True if any additional C code is included. */
  47. } KEY_LIST;
  48.  
  49. extern    void            key_list_init( void );
  50. extern    void            key_list_destroy( void );
  51. extern    void            print_output( void );
  52. extern    void            read_keys( void );
  53. extern    void            reorder( void );
  54. extern    int                length( void );
  55. extern    int                max_key_length( void );
  56. extern    void            sort( void );
  57.  
  58. extern KEY_LIST        key_list;
  59.  
  60. #endif /* _keylist_h */
  61.